package com.qf.form;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.util.Date;

public class test {
    //    @JsonSerialize(using = Date2LongSerializer.class)  //json自己的序列化
    //    @JsonInclude(JsonInclude.Include.NON_NULL)//如果为null的json值，那么不输出
    //    @JsonProperty(value = "name")//这个时不接收接收到的username,返回给客户端一个新的name
    //    @JsonIgnore                 //忽略json回传的属性

    @NotBlank                   // username != null && !username.eq("")
    @NotNull                    //针对所有类型，不让其为null
    private String username;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date dates;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Date getDates() {
        return dates;
    }

    public void setDates(Date dates) {
        this.dates = dates;
    }

    @Override
    public String toString() {
        return "test{" +
                "username='" + username + '\'' +
                ", dates=" + dates +
                '}';
    }
}
